home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 676-700 / 676 / fbm / fbm10ami.zoo / fbm.diffs < prev    next >
Text File  |  1992-05-08  |  11KB  |  385 lines

  1. diff -a -d +context fbm/fbext.c dh1:fbm10/fbext.c
  2. *** fbm/fbext.c    Mon Jun 25 04:17:50 1990
  3. --- dh1:fbm10/fbext.c    Wed Apr 08 23:26:14 1992
  4. ***************
  5. *** 32,40 ****
  6.    *    Created.
  7.    *****************************************************************/
  8.   
  9. ! # include <stdio.h>
  10. ! # include <math.h>
  11. ! # include "fbm.h"
  12.   
  13.   int allowrot = 0;
  14.   
  15. --- 32,48 ----
  16.    *    Created.
  17.    *****************************************************************/
  18.   
  19. ! #include <stdio.h>
  20. ! #include <math.h>
  21. ! #ifdef LATTICE_50
  22. ! #ifdef MFFP
  23. ! #include <mffp.h>
  24. ! #endif
  25. ! #ifdef M881
  26. ! #include <m68881.h>
  27. ! #endif
  28. ! #endif
  29. ! #include "fbm.h"
  30.   
  31.   int allowrot = 0;
  32.   
  33. ***************
  34. *** 55,62 ****
  35.   { int xo = -1, yo = -1, w = -1, h = -1, ow = -1, oh = -1, size = -1;
  36.     int mh = -1, mw = -1;
  37.     double aspect = -1.0;
  38. !   char title[FBM_MAX_TITLE], credits[FBM_MAX_TITLE];
  39. !   FBM input, rotated, output, *image = &input;
  40.     int outtype = FMT_FBM;
  41.   
  42.     /* Clear the memory pointers so alloc_fbm won't be confused */
  43. --- 63,70 ----
  44.   { int xo = -1, yo = -1, w = -1, h = -1, ow = -1, oh = -1, size = -1;
  45.     int mh = -1, mw = -1;
  46.     double aspect = -1.0;
  47. !   static char title[FBM_MAX_TITLE], credits[FBM_MAX_TITLE];
  48. !   static FBM input, rotated, output, *image = &input;
  49.     int outtype = FMT_FBM;
  50.   
  51.     /* Clear the memory pointers so alloc_fbm won't be confused */
  52. diff -a -d +context fbm/fbinfo.c dh1:fbm10/fbinfo.c
  53. *** fbm/fbinfo.c    Mon Jun 25 04:19:08 1990
  54. --- dh1:fbm10/fbinfo.c    Tue Dec 11 17:01:36 1990
  55. ***************
  56. *** 46,68 ****
  57.     FILE *infile;
  58.     char name[128], cmd[256];
  59.   
  60. !   if (argc == 1)
  61. !   { binfo ((char *) NULL, stdin); }
  62. !   else
  63. !   { for (i=1; i<argc; i++)
  64. !     { strcpy (name, argv[i]);
  65.   
  66. !       if (strcmp (name + strlen (name) - 2, ".Z") == 0)
  67. !       { sprintf (cmd, "(uncompress < %s | select 0 255) 2> /dev/null", name); 
  68. !         if (infile = popen (cmd, "r"))
  69. !     { binfo (name, infile); pclose (infile); }
  70. !     else
  71. !     { perror (cmd); }
  72.         }
  73. !       else if (infile = fopen (argv[i], "r"))
  74. !       { binfo (argv[i], infile); fclose (infile); }
  75. !       else
  76. !       { perror (argv[i]); }
  77.       }
  78.     }
  79.   }
  80. --- 46,75 ----
  81.     FILE *infile;
  82.     char name[128], cmd[256];
  83.   
  84. !   if (argc == 1) {
  85. !     binfo ((char *) NULL, stdin);
  86. !   }
  87. !   else {
  88. !     for (i=1; i<argc; i++) {
  89. !       strcpy (name, argv[i]);
  90.   
  91. !       if (strcmp (name + strlen (name) - 2, ".Z") == 0) {
  92. ! #ifndef AMIGA
  93. !         sprintf (cmd, "(uncompress < %s | select 0 255) 2> /dev/null", name);
  94. !         if (infile = popen (cmd, "r")) {
  95. !           binfo (name, infile);
  96. !           pclose (infile);
  97. !         }
  98. !     else perror (cmd);
  99. ! #else
  100. !     fprintf(stderr,"error: File is compressed\n");
  101. !         perror("aborted");
  102. ! #endif
  103.         }
  104. !       else if (infile = fopen (argv[i], "r")) {
  105. !         binfo (argv[i], infile); fclose (infile);
  106. !       }
  107. !       else perror (argv[i]);
  108.       }
  109.     }
  110.   }
  111. diff -a -d +context fbm/fbm.h dh1:fbm10/fbm.h
  112. *** fbm/fbm.h    Mon Jun 25 04:19:08 1990
  113. --- dh1:fbm10/fbm.h    Fri Dec 14 11:08:13 1990
  114. ***************
  115. *** 107,112 ****
  116. --- 107,113 ----
  117.       unsigned char *bm;        /* Pointer to raw bits */
  118.   } FBM;
  119.   
  120. + #ifndef ANSI_C
  121.   /* Functions */
  122.   double atof ();
  123.   char *strcpy();
  124. ***************
  125. *** 118,123 ****
  126. --- 119,137 ----
  127.   
  128.   long time (), get_long ();
  129.   int get_short ();
  130. + #else
  131. + #include <stdio.h>
  132. + #include <stdlib.h>
  133. + #include <string.h>
  134. + #include <time.h>
  135. + long get_long ();
  136. + int get_short ();
  137. + #endif
  138. + #ifdef LATTICE_50
  139. + double atof(const char *s);
  140. + #endif
  141.   
  142.   /* Macro for getting next magic char */
  143.   # define NEXTMCH(F,S,L) (((L) > 0) ? ((L)--, *(S)++) : getc (F))
  144. diff -a -d +context fbm/fbps.c dh1:fbm10/fbps.c
  145. *** fbm/fbps.c    Mon Jun 25 04:19:50 1990
  146. --- dh1:fbm10/fbps.c    Tue Dec 11 17:12:20 1990
  147. ***************
  148. *** 38,43 ****
  149. --- 38,47 ----
  150.   # include <math.h>
  151.   # include "fbm.h"
  152.   
  153. + #ifdef ANSI_C
  154. + #define index(a,b) strchr(a,b)
  155. + #endif
  156.   # define PAPERWIDTH 8.5 /* inches */
  157.   # define BIGPAPERWIDTH 11 /* inches */
  158.   # define PAPERHEIGHT 11 /* inches */
  159. ***************
  160. *** 270,277 ****
  161.   char *txt;
  162.   { static char buf[512];
  163.     register char *s = buf;
  164.     char *index ();
  165. !   
  166.     for (; *txt; txt++)
  167.     { if (index ("()\\", *txt))
  168.       { *s++ = '\\'; *s++ = *txt; }
  169. --- 274,283 ----
  170.   char *txt;
  171.   { static char buf[512];
  172.     register char *s = buf;
  173. + #ifndef ANSI_C
  174.     char *index ();
  175. ! #endif  
  176.     for (; *txt; txt++)
  177.     { if (index ("()\\", *txt))
  178.       { *s++ = '\\'; *s++ = *txt; }
  179. diff -a -d +context fbm/fbquant.c dh1:fbm10/fbquant.c
  180. *** fbm/fbquant.c    Mon Jun 25 04:19:56 1990
  181. --- dh1:fbm10/fbquant.c    Fri Dec 14 12:50:49 1990
  182. ***************
  183. *** 109,114 ****
  184. --- 109,122 ----
  185.       short color;
  186.   } PIXEL;
  187.   
  188. + #ifdef ANSI_C
  189. + sample_image (FBM *image, int *hist);
  190. + build_colormap (int *hist, COLOR *cmap, int colors);
  191. + split_box (PIXEL *box, int boxlen, int clr, int numclr, COLOR *cmap);
  192. + box_weight (PIXEL *box, int boxlen);
  193. + clr_quantize (FBM *input, FBM *output, COLOR *cmap, int colors);
  194. + #endif
  195.   int debug=0, verbose=0, colors=256, showcolor=0, dither=1;
  196.   int resbits = -1, resmask = 0xff;
  197.   double flesh = 1.0, atof();
  198. ***************
  199. *** 131,137 ****
  200.   main (argc, argv)
  201.   char *argv[];
  202.   { FBM input, output, mapimage;    /* Images */
  203. !   int hist[CUBSIZ];        /* Color cube 32x32x32 for histogram */
  204.     int outtype = DEF_8BIT;    /* Output format desired */
  205.     char *mapfile = NULL;        /* Name of file to copy map from */
  206.     register int c;
  207. --- 139,145 ----
  208.   main (argc, argv)
  209.   char *argv[];
  210.   { FBM input, output, mapimage;    /* Images */
  211. !   static int hist[CUBSIZ];        /* Color cube 32x32x32 for histogram */
  212.     int outtype = DEF_8BIT;    /* Output format desired */
  213.     char *mapfile = NULL;        /* Name of file to copy map from */
  214.     register int c;
  215. ***************
  216. *** 142,173 ****
  217.     mapimage.bm = mapimage.cm = (unsigned char *) NULL;
  218.   
  219.     /* Get the options */
  220. !   while (--argc > 0 && (*++argv)[0] == '-')
  221. !   { while (*++(*argv))
  222. !     { switch (**argv)
  223. !       { case 'c':    colors = atoi (*argv+1); SKIPARG; break;
  224.           case 'f':    flesh = atof (*argv+1); SKIPARG; break;
  225.           case 'r':    resbits = atoi (*argv+1); SKIPARG; break;
  226.           case 'm':    mapfile = *argv+1; SKIPARG; break;
  227. !     case 'n':    dither = 0; break;
  228. !     case 'd':    debug++; break;
  229. !     case 'D':    showcolor++; break;
  230. !     case 'v':    verbose++; break;
  231. !     case 'A':    outtype = FMT_ATK; break;
  232. !     case 'B':    outtype = FMT_FACE; break;
  233. !     case 'F':    outtype = FMT_FBM; break;
  234. !     case 'G':    outtype = FMT_GIF; break;
  235. !     case 'I':    outtype = FMT_IFF; break;
  236. !     case 'L':    outtype = FMT_LEAF; break;
  237. !     case 'M':    outtype = FMT_MCP; break;
  238. !     case 'P':    outtype = FMT_PBM; break;
  239. !     case 'R':    outtype = FMT_RLE; break;
  240. !     case 'S':    outtype = FMT_SUN; break;
  241. !     case 'T':    outtype = FMT_TIFF; break;
  242. !     case 'X':    outtype = FMT_X11; break;
  243. !     case 'Z':    outtype = FMT_PCX; break;
  244. !     default:    fprintf (stderr, "%s\n", USAGE);
  245. !             exit (1);
  246.         }
  247.       }
  248.     }
  249. --- 150,181 ----
  250.     mapimage.bm = mapimage.cm = (unsigned char *) NULL;
  251.   
  252.     /* Get the options */
  253. !   while (--argc > 0 && (*++argv)[0] == '-') {
  254. !     while (*++(*argv)) {
  255. !       switch (**argv) {
  256. !         case 'c':    colors = atoi (*argv+1); SKIPARG; break;
  257.           case 'f':    flesh = atof (*argv+1); SKIPARG; break;
  258.           case 'r':    resbits = atoi (*argv+1); SKIPARG; break;
  259.           case 'm':    mapfile = *argv+1; SKIPARG; break;
  260. !         case 'n':    dither = 0; break;
  261. !         case 'd':    debug++; break;
  262. !         case 'D':    showcolor++; break;
  263. !         case 'v':    verbose++; break;
  264. !         case 'A':    outtype = FMT_ATK; break;
  265. !         case 'B':    outtype = FMT_FACE; break;
  266. !         case 'F':    outtype = FMT_FBM; break;
  267. !         case 'G':    outtype = FMT_GIF; break;
  268. !         case 'I':    outtype = FMT_IFF; break;
  269. !         case 'L':    outtype = FMT_LEAF; break;
  270. !         case 'M':    outtype = FMT_MCP; break;
  271. !         case 'P':    outtype = FMT_PBM; break;
  272. !         case 'R':    outtype = FMT_RLE; break;
  273. !         case 'S':    outtype = FMT_SUN; break;
  274. !         case 'T':    outtype = FMT_TIFF; break;
  275. !         case 'X':    outtype = FMT_X11; break;
  276. !         case 'Z':    outtype = FMT_PCX; break;
  277. !       default:    fprintf (stderr, "%s\n", USAGE);
  278. !         exit (1);
  279.         }
  280.       }
  281.     }
  282. ***************
  283. *** 338,344 ****
  284.   COLOR *cmap;
  285.   int colors;
  286.   { register int i, k;
  287. !   PIXEL box[CUBSIZ];
  288.     register PIXEL *b;
  289.     int used=0, t;
  290.   
  291. --- 346,352 ----
  292.   COLOR *cmap;
  293.   int colors;
  294.   { register int i, k;
  295. !   static PIXEL box[CUBSIZ];
  296.     register PIXEL *b;
  297.     int used=0, t;
  298.   
  299. diff -a -d +context fbm/flread.c dh1:fbm10/flread.c
  300. *** fbm/flread.c    Mon Jun 25 03:19:06 1990
  301. --- dh1:fbm10/flread.c    Tue Dec 11 16:05:03 1990
  302. ***************
  303. *** 71,88 ****
  304.     peekch = fgetc (rfile);
  305.   
  306.     /* If the image is compressed, uncompress it while reading */  
  307. !   if (peekch == COMPRESSED_CHAR)
  308. !   { if (rfile == stdin)
  309. !     { if (lseek (fileno (rfile), 0L, 0) < 0)  perror ("lseek");
  310.         rfile = popen ("uncompress", "r");
  311.       }
  312. !     else
  313. !     { fclose (rfile);
  314.         sprintf (cmd, "uncompress < %s", fname);
  315.         rfile = popen (cmd, "r");
  316. !     }
  317.       do_pclose++;
  318.       peekch = fgetc (rfile);
  319.     }
  320.     
  321. --- 71,92 ----
  322.     peekch = fgetc (rfile);
  323.   
  324.     /* If the image is compressed, uncompress it while reading */  
  325. !   if (peekch == COMPRESSED_CHAR) {
  326. ! #ifndef AMIGA
  327. !     if (rfile == stdin) {
  328. !       if (lseek (fileno (rfile), 0L, 0) < 0)  perror ("lseek");
  329.         rfile = popen ("uncompress", "r");
  330.       }
  331. !     else {
  332. !       fclose (rfile);
  333.         sprintf (cmd, "uncompress < %s", fname);
  334.         rfile = popen (cmd, "r");
  335. !     };
  336.       do_pclose++;
  337. ! #else
  338. !     fprintf(stderr,"error: File is in compressed format\n");
  339. !     exit(1);
  340. ! #endif
  341.       peekch = fgetc (rfile);
  342.     }
  343.     
  344. ***************
  345. *** 106,113 ****
  346. --- 110,121 ----
  347.       default:        fprintf (stderr, "Unknown magic char %03o\n", peekch);
  348.     }
  349.     
  350. + #ifndef AMIGA
  351.     if (do_pclose)    pclose (rfile);
  352.     else            fclose (rfile);
  353. + #else
  354. +   fclose (rfile);
  355. + #endif
  356.     
  357.     return (result);
  358.   }
  359. diff -a -d +context fbm/tiff2fbm.c dh1:fbm10/tiff2fbm.c
  360. *** fbm/tiff2fbm.c    Mon Jun 25 04:20:28 1990
  361. --- dh1:fbm10/tiff2fbm.c    Thu Apr 09 01:44:58 1992
  362. ***************
  363. *** 85,91 ****
  364.       case 'a':    aspect = atof (*argv+1); SKIPARG; break;
  365.       case 't':    title = *argv+1; SKIPARG; break;
  366.       case 'c':    credits = *argv+1; SKIPARG; break;
  367. !     default:        if (!isdigit (argv[0][1]))
  368.               { fprintf (stderr, "%s\n", USAGE);
  369.                             exit (1);
  370.               }
  371. --- 85,91 ----
  372.       case 'a':    aspect = atof (*argv+1); SKIPARG; break;
  373.       case 't':    title = *argv+1; SKIPARG; break;
  374.       case 'c':    credits = *argv+1; SKIPARG; break;
  375. !     default:        if (!isdigit (argv[0][0]))
  376.               { fprintf (stderr, "%s\n", USAGE);
  377.                             exit (1);
  378.               }
  379.